<template>
  <!--
      	作者：luoyiming
      	时间：2020-06-25
      	描述：插件中心-限时拼团-活动列表-编辑活动-其它
      -->
  <div>
    <div class="common-form">其它</div>

    <el-form-item label="活动排序" :rules="[{ required: true, message: '请输入活动排序' }]" prop="sort">
      <div class="max-w460">
        <el-input v-model="form.sort" type="number"></el-input>
      </div>
    </el-form-item>
    <el-form-item label="是否生效">
      <el-radio-group v-model="form.status">
        <el-radio :label="0">未生效</el-radio>
        <el-radio :label="1">生效</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="首页小标">
      <div class="max-w460">
        <el-input v-model="form.assemble_title" type="text"></el-input>
      </div>
    </el-form-item>
    <el-form-item label="小标描述">
      <div class="max-w460">
        <el-input v-model="form.assemble_exp" type="text"></el-input>
      </div>
    </el-form-item>
    <!-- <el-form-item label="首页小标图：">
        <el-row>
          <el-button icon="el-icon-picture-outline" @click="openProductUpload('image','assemble_title_img')">选择图片</el-button>
          <div v-if="form.assemble_title_img" class="img mt10">
            <img :src="form.assemble_title_img" width="100" height="100"/>
          </div>
        </el-row>
    </el-form-item> -->

    <!--图片组件-->
     <Upload v-if="isProductUpload" :config="config" :isupload="isProductUpload" @returnImgs="returnProductImgsFunc">
      上传图片
    </Upload>
  </div>
</template>

<script>
import Upload from '@/components/file/Upload';
export default {
  props: ['form'],
  components: {
    Upload
  },
  data() {
      return {
        /*form表单数据*/
        isProductUpload:false,

      }
    },

  methods: {
    /*打开上传图片*/
    openProductUpload: function (file_type, file_name) {
      this.file_name = file_name;
      if (file_type == 'image') {
        this.config = {
          total: 1,
          file_type: 'image'
        };
      }
      this.isProductUpload = true;
    },

    /*上传商品图片*/
    returnProductImgsFunc(e) {
      if (e != null) {
        this.$set(this.form,this.file_name,e[0].file_path);
      }
      this.isProductUpload = false;
    },
  }
};
</script>

<style></style>
